import request from '@/utils/request'

const baseUrl = 'http://localhost:9083/basic/menu'

export function queryUserMenu() {
  return request({
    baseURL: baseUrl,
    url: '/userMenus',
    method: 'post'
  })
}

export function queryMenuNodeTree(data) {
  return request({
    baseURL: baseUrl,
    url: '/menuNodeTree',
    method: 'post',
    data
  })
}

export function queryMenuInfo(id) {
  return request({
    baseURL: baseUrl,
    url: '/info',
    method: 'get',
    params: { id }
  })
}

export function saveMenuInfo(url, data) {
  return request({
    baseURL: baseUrl,
    url: url,
    method: 'post',
    data
  })
}

export function deleteMenu(id) {
  return request({
    baseURL: baseUrl,
    url: '/delete',
    method: 'get',
    params: { id }
  })
}
